<include file="Public/min-header" />
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">

    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 推送列表 
                        <a href="{:U('Admin/Wechat/addNews')}">
                            <button type="button" class="btn btn-info">
                                <i class="ace-icon fa fa-plus bigger-110"></i>
                            </button>
                        </a>
                    </h3>
                </div>
                <div class="panel-body">
                    <div id="ajax_return">
                        <div class="table-responsive">
                            <table class="table table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th style="width: 1px;" class="text-center">
                                            <input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);">
                                        </th>
                                        <th class="text-center">关键词</th>
                                        <th width = "10%" class="text-center">图文列表</th>
                                        <th width = "10%" class="text-center">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <volist name="lists" id="list">
                                    <tr>
                                        <td class="text-center">
                                            <input type="checkbox" name="selected[]" value="{$list.id}">
                                        </td>
                                        <td class="text-left">{$list.keyword}</td>
                                        <td class="text-center">
                                            <button class="btn btn-info btn-sm" type="button" onclick="preview('{$list.pid}')">预览</button>
                                        </td>
                                        <td class="th">
                                            <a href="javascript:;" data-href="{:U('Admin/Wechat/delNews',array('id'=>$list['id']))}" onclick="del('{$list[id]}', this)" id="button-delete6" data-toggle="tooltip" title="" class="btn btn-danger" data-original-title="删除"><i class="fa fa-trash-o"></i></a>
                                        </td>
                                    </tr>
                                </volist>
                                </tbody>
                            </table>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
// 删除操作
    function del(id, t) {
        if (!confirm('确定要删除吗?'))
            return false;

        location.href = $(t).data('href');
    }

    function preview(id) {
        layer.open({
            type: 2,
            title: false,
            closeBtn: false,
            area: ['320px', '500px'],
            skin: 'layui-layer-nobg', //没有背景色
            shadeClose: true,
            content: "/index.php/Admin/Wechat/preview/id/" + id,
        });
    }
</script>
</body>

</html>
